#include "DetectorWidget.h"
//#include "ui_widget.h"
#include <QtGui>
#include <QPen>
#include <QLabel>

#include "rootNode.h"

DetectorWidget::DetectorWidget()
{
    runButton = new QToolButton;
    runButton->setText(tr("RUN DETECTOR"));

	canvas= new QLabel;


    /*add controls into UI*/
    QGridLayout *mainLayout = new QGridLayout;
    mainLayout->addWidget(runButton,0,0,3,1);
    mainLayout->setSizeConstraint(QLayout::SetFixedSize);
    setLayout(mainLayout);
    setWindowTitle(tr("Hello World"));

	 connect(runButton, SIGNAL(clicked()), this, SLOT(callInference()));
}

void DetectorWidget::callInference(){
	const char* path_name = "D:/Projects/AoT/results_archive/results";
	const char* img_name ="D:/Projects/AoT/testPrepData/car_A5_H2_S1";
	
	std::vector<int> node_id; 
	node_id.push_back(1);
	node_root.initialRootNode(path_name,node_id);
	node_root.inference(img_name);
	
}

DetectorWidget::~DetectorWidget()
{
    //delete ui;
}
